<html>
	<head>
              <script type='text/javascript' src='jquery.js' ></script>
		<title>form wid javascript</title>

<script type="text/javascript">

$(document).ready(function(){
    $('#call_ajax').submit(function(){




         		var username_from_form = $("#username").val();


                if (username_from_form == "") {
				alert("Please provide username alert from javascript!!!");
                                return false;
			}
                        else {


                            $.ajax({
                                 type: "POST",
                                url: "form_process.php",
                                data: "user="+username_from_form,
                                success: function(response) {
                                   
                                    $("#message").html(response);
                                     //alert(response);
                                     
                                }
                            });

                            return false;

			}


    });
});


</script>

	</head>

	<body>
	<!-- <a href="#" onclick="display();">sample</a>  -->
		 <form action="form_process.php" method="POST" onsubmit="return display(this);" id="call_ajax">
			username <input type="textbox" id ="username" name="username"/>
			<input id ="submit" type = "submit" value = "Check!!"/>

		</form>
        <div id="message" ></div>


	</body>

</html>